{include file="admin/public/page_head.html"}
<div class="easyui-tabs" data-options="fit:true,border:false">
	<div title="{$html_title}" style="padding:20px;overflow:auto;">
		<div style="margin-top:5px;">
			<form method="post" action="?at=user&st=add_user_action" id="websit_config">
				<div id="stypestate" style="">
					<h2 class="h1">{$top_1_title}</h2>
					<div class="admin_table mb10">
						<table width="100%" cellspacing="0" cellpadding="0">
							<tr class="tr1 vt">
								<td class="td1">用户名</td>
								<td id="bbsifopen" class="td2">
								<ul style="float:none;width:200px;" class="list_A cc">
									<li class="current">
										<input class="easyui-validatebox" name="user_name" data-options="required:true,validType:'length[3,10]'">
									</li>
								</ul></td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									添加用户名
								</div></td>
							</tr>
							<tr class="tr1 vt">
								<td class="td1">用户姓名</td>
								<td class="td2">
								<input class="easyui-validatebox" name="user_full_name" data-options="required:true,validType:'length[1,10]'">
								</td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									用户密码
								</div></td>
							</tr>
							<tr class="tr1 vt">
								<td class="td1">用户密码</td>
								<td class="td2">
								<input class="easyui-validatebox" name="user_password" data-options="required:true,validType:'length[3,10]'">
								</td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									用户密码
								</div></td>
							</tr>
							<tr class="tr1 vt">
								<td class="td1">所属小组</td>
								<td class="td2">
								<select class="easyui-combobox" id="user_group" name="user_group" style="width:170px;" data-options="panelHeight: 'auto',valueField:'id',
								textField:'user_group_title',url:'./index.php?at=usergroup&st=get_list&code=json'">
									<option value="0">请选择...</option>
								</select></td>
								<td class="td2">
								<div class="help_a" style="display: block;">
									所属小组，只能选择一个
								</div></td>
							</tr>
						</table>
					</div>
					<div class="tac mb10">
						<span class="btn" id="submit"><span> <a href="#" class="easyui-linkbutton" id="form_action" data-options="plain:true,iconCls:'icon-save',disabled:1">递交</a> </span></span>
					</div>
				</div>
				<div style="display: none">
					<input id="user_id" value="{$user_id}" name="user_id" />
				</div>
			</form>
		</div>
	</div>
</div>

{literal}
<script type="text/javascript">
	$(function() {
		var _userID = $("#user_id").val();
		if (_userID != '') {
			// console.info(123);
			$("#websit_config").form({
				onLoadSuccess : function() {
					$("#form_action").linkbutton('enable');
				}
			})
			$("#websit_config").form('load', './index.php?at=user&st=info&code=json&id=' + _userID);

			$("input[name='user_password']").validatebox({
				required : 0
			});

			$("input[name='user_name']").attr('readonly', true);
		}else{
			$("#form_action").linkbutton('enable');
		}

		$("a", $("#submit")).click(function() {
			var _o = $("#form_action").linkbutton('options');
			if(_o.disabled){
				alert('请等待，或数据获取出错...');
				return false;
			}
			
			if ($("#user_group").combobox('getValue') * 1 == 0) {
				alert('请选择分组！');
				return false;
			}

			var _o = $(this).linkbutton('options');
			if (!_o.disabled) {
				$("#websit_config").submit();
			}
		})
	})
</script>
{/literal}
{include file="admin/public/page_foot.html"}